package cn.lbf.stuniversity.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;

@Data
public class PageVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonProperty(value = "页号", required = true)
    @NotNull(message = "pageNumber 不能为空")
    private int pageNumber;

    @JsonProperty(value = "页面大小", required = true)
    @NotNull(message = "pageSize 不能为空")
    private int pageSize;

    @JsonProperty(value = "排序字段")
    private String sort;

    @JsonProperty(value = "排序方式 asc/desc")
    private String order;

    public PageVO() {
        super();
        this.pageNumber = 1;
        this.pageSize = 10;
    }

    public PageVO(int pageNumber, int pageSize) {
        this.pageNumber = pageNumber;
        this.pageSize = pageSize;
    }
}
